package com.supervision.manage.mapper

import com.fly.base.mybatis.sqlprovider.SqlProvider
import com.supervision.domain.bean.po.UserSearchPO
import com.supervision.manage.mapper.sqlprovider.UserSqlProvider
import com.supervision.domain.bean.vo.UserVO
import com.supervision.domain.model.User
import org.apache.ibatis.annotations.Mapper
import org.springframework.stereotype.Component
import org.apache.ibatis.annotations.Param
import org.apache.ibatis.annotations.SelectProvider

@Mapper
@Component
interface UserMapper {

    @SelectProvider(type = SqlProvider::class, method = "select")
    fun select(@Param("condition") condition: Any, @Param("otherCondition") otherCondition: String?): List<User>

    @SelectProvider(type = UserSqlProvider::class, method = "getUserList")
    fun getUserList(@Param("po") po: UserSearchPO, @Param("limitSql") limitSql: String): List<UserVO>

    @SelectProvider(type = UserSqlProvider::class, method = "getUserList")
    fun countUserList(po: UserSearchPO, limitSql: String): Int
}
